import Vue from 'vue'
import VueRouter from 'vue-router'
const Home = () => import('@/views/home/') // 首页
const Classify = () => import('@/views/classify/') // 详情
const Cart = () => import('@/views/cart/') // 购物车
const My = () => import('@/views/my/') // 我的
const Particulars = () => import('@/views/particulars/') // 分类
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/classify/:iid',
    name: 'classify',
    component: Classify
  },
  {
    path: '/cart',
    name: 'cart',
    component: Cart
  }, {
    path: '/my',
    name: 'my',
    component: My
  }, {
    path: '/particulars',
    name: 'particulars',
    component: Particulars
  }
]

const router = new VueRouter({
  routes
})

export default router
